<template>
	<div class="notice_detail_wrapper">
		<div class="head">
			<h1>{{ articleData.title }}</h1>
			<p>
				<span>作者：{{ articleData.author }}</span>
				<!-- <span>编辑：振华</span> -->
				<span>发布时间：{{ articleData.pubDate }}</span>
				<span>浏览次数：{{ articleData.clickCount }}</span>
			</p>
		</div>
		<div class="cont" v-html="articleData.content"></div>
	</div>
</template>

<script>
import { mapActions } from 'vuex';
export default {
	data() {
		return {
			articleData: {}
		};
	},
	computed: {
		articleId() {
			return this.$route.params.id;
		}
	},
	mounted() {
		this.getArticleDetail();
	},
	methods: {
		...mapActions(['getNewsDetail']),
		//获取文章详情
		getArticleDetail() {
			this.getNewsDetail(this.articleId).then(res => {
				this.articleData = { ...res };
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.notice_detail_wrapper {
	padding-bottom: 64px;
	.head {
		text-align: center;
		h1 {
			font-size: 24px;
			line-height: 1.5;
		}
		p {
			padding: 10px 0;
			margin-top: 10px;
			color: rgba(0, 0, 0, 0.4);
			span {
				margin: 0 20px;
			}
		}
	}
	.cont {
		font-size: 18px;
		padding: 20px 0;
		color: #666;
		line-height: 2;
		p {
			margin-bottom: 2em;
		}
		img {
			display: block;
			max-width: 100%;
		}
	}
}
</style>
